//:  v.book.read.tip.statemachine2.vm.VendingMachineTest.java
package v.book.read.tip.statemachine2.vm;

import junit.framework.TestCase;
import v.book.read.tip.statemachine2.Input;
import v.book.read.tip.statemachine2.vm.input.FirstDigit;
import v.book.read.tip.statemachine2.vm.input.Money;
import v.book.read.tip.statemachine2.vm.input.Quit;
import v.book.read.tip.statemachine2.vm.input.SecondDigit;

public class VendingMachineTest extends TestCase {
    VendingMachine vm = new VendingMachine();
    Input[] inputs = {
      Money.quarter, // 25
      Money.quarter, // 25
      Money.dollar, // 100
      FirstDigit.A,
      SecondDigit.two,
      FirstDigit.A,
      SecondDigit.two,
      FirstDigit.C,
      SecondDigit.three,
      FirstDigit.D,
      SecondDigit.one,
      Quit.quit,
    };
    public void test() {
      for(int i = 0; i < inputs.length; i++)
        vm.nextState(inputs[i]);
    }
    public static void main(String[] args) {
      junit.textui.TestRunner.run(VendingMachineTest.class);
    }
  } ///:~
